#ifndef HELPERS_H_
#define HELPERS_H_
#include <stdio.h>
#include <string.h>
#include "entities.h"

extern int lineNumber;
ArgumentType GetArgumentType(char *str, int *cmdIndex, RegistersList *regs, CommandsList *cmds);
boolean IsLabel(char *str, RegistersList *regs, CommandsList *cmds);
boolean IsValidLabel(char *str, CommandsList *cmds, RegistersList *regs);
boolean IsCommand(char *str, int *cmdIndex, CommandsList* cmds);
boolean IsRegister(int *regIndex, char *name, RegistersList *regs);
boolean IsValidNumber(char *str, int *number);
boolean IsIndexed(char *str, char *label, char *operand, char *dataIndex, RegistersList *regs, CommandsList *cmds);
int FindLabel(char *labelName, LabelsList *labels);
int FindExternLabel(char *labelName, ExternLabelsList *labels);
int GetLabelAddress(char *str, LabelsList *labels, ExternLabelsList *externs);
boolean IsCommandExists(char *name, CommandsList *cmds);
boolean IsValidOperandLabel(char *str, RegistersList *regs, CommandsList *cmds);
boolean IsLegalAddressingMethod(int cmdIndex, OperandType opType, AddressingMethod method);
long DecToBase8(long num);
void WriteObjectFile(char *filePath, ObjectsList *objs, long *memory, int instructC, int dataC);
void WriteEntryFile(char *filePath, EntriesLabelsList *ents, int entC);
void WriteExternFile(char *filePath, ExternLabelsList *exts, int extC);
void Usage();
#endif /* HELPERS_H_ */
